<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         :root,
        body {
            height: 100%;
            background: linear-gradient(to bottom, #ff6e7f, #bfe9ff);
        }
        
        .box1 {
            width: 300px;
            height: 300px;
            border: 10px solid gray;
            background: linear-gradient(to right top, #DAE2F8, #D6A4A4);
            /* 1.支持多颜色渐变，默认从上到下 */
            /* 2.支持方向  to+方向   也可以两个方向*/
            /* 3.支持角度  度数dog  0deg 10deg */
        }
        
        .box2 {
            width: 300px;
            height: 300px;
            border: 10px solid gray;
            background: linear-gradient(44deg, #DC2424, #4A569D);
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>